<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>ArduinoUnit 2.0: FakeStream Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ArduinoUnit 2.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_fake_stream-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">FakeStream Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="_fake_stream_8h_source.html">FakeStream.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for FakeStream:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_fake_stream.png" usemap="#FakeStream_map" alt=""/>
  <map id="FakeStream_map" name="FakeStream_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0380298b22826fe3d45f6a2bb1f05cbe"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a0380298b22826fe3d45f6a2bb1f05cbe">FakeStream</a> ()</td></tr>
<tr class="separator:a0380298b22826fe3d45f6a2bb1f05cbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20cea3759f1645f9729002bdfda75dcf"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a20cea3759f1645f9729002bdfda75dcf">~FakeStream</a> ()</td></tr>
<tr class="separator:a20cea3759f1645f9729002bdfda75dcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02fd44b84cc3ca6dc3f91eb9b78e097a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a02fd44b84cc3ca6dc3f91eb9b78e097a">write</a> (uint8_t val)</td></tr>
<tr class="separator:a02fd44b84cc3ca6dc3f91eb9b78e097a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40864daa1e5a3920da14142e19485604"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a40864daa1e5a3920da14142e19485604">flush</a> ()</td></tr>
<tr class="separator:a40864daa1e5a3920da14142e19485604"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b2f32a9257cba71c6056a3bc02eac6f"><td class="memItemLeft" align="right" valign="top">const String &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a1b2f32a9257cba71c6056a3bc02eac6f">bytesWritten</a> ()</td></tr>
<tr class="separator:a1b2f32a9257cba71c6056a3bc02eac6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e310812ee74cf355b8fde8edb1d8579"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a5e310812ee74cf355b8fde8edb1d8579">setToEndOfStream</a> ()</td></tr>
<tr class="separator:a5e310812ee74cf355b8fde8edb1d8579"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b37e51beae0c92064eb81c06b5076cd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a4b37e51beae0c92064eb81c06b5076cd">nextByte</a> (byte b)</td></tr>
<tr class="separator:a4b37e51beae0c92064eb81c06b5076cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a425db0fb16e50da74ea573be6c655711"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a425db0fb16e50da74ea573be6c655711">available</a> ()</td></tr>
<tr class="separator:a425db0fb16e50da74ea573be6c655711"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d11124a60e344a1baf58afd696aa5d0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a5d11124a60e344a1baf58afd696aa5d0">read</a> ()</td></tr>
<tr class="separator:a5d11124a60e344a1baf58afd696aa5d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8db1c0fea7e029cd3ba23cfe8676e205"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_fake_stream.html#a8db1c0fea7e029cd3ba23cfe8676e205">peek</a> ()</td></tr>
<tr class="separator:a8db1c0fea7e029cd3ba23cfe8676e205"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A fake stream which can be used in place of other streams to inject bytes to be read and to record any bytes written.</p>
<dl class="section author"><dt>Author</dt><dd>Matthew Murdoch </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a0380298b22826fe3d45f6a2bb1f05cbe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FakeStream::FakeStream </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a fake stream. Until <a class="el" href="class_fake_stream.html#a4b37e51beae0c92064eb81c06b5076cd">nextByte()</a> is called all bytes returned from <a class="el" href="class_fake_stream.html#a5d11124a60e344a1baf58afd696aa5d0">read()</a> or <a class="el" href="class_fake_stream.html#a8db1c0fea7e029cd3ba23cfe8676e205">peek()</a> will be -1 (end-of-stream). </p>

</div>
</div>
<a class="anchor" id="a20cea3759f1645f9729002bdfda75dcf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">FakeStream::~FakeStream </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destroys this fake stream. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a425db0fb16e50da74ea573be6c655711"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FakeStream::available </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The number of bytes available to be read.</p>
<dl class="section return"><dt>Returns</dt><dd>the number of available bytes (always 1) </dd></dl>

</div>
</div>
<a class="anchor" id="a1b2f32a9257cba71c6056a3bc02eac6f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const String &amp; FakeStream::bytesWritten </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The bytes written by calling <a class="el" href="class_fake_stream.html#a02fd44b84cc3ca6dc3f91eb9b78e097a">write(uint8_t)</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>the bytes written </dd></dl>

</div>
</div>
<a class="anchor" id="a40864daa1e5a3920da14142e19485604"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FakeStream::flush </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Flushes this stream. Does nothing in this implementation. </p>

</div>
</div>
<a class="anchor" id="a4b37e51beae0c92064eb81c06b5076cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FakeStream::nextByte </td>
          <td>(</td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the value of the next byte to be read via <a class="el" href="class_fake_stream.html#a5d11124a60e344a1baf58afd696aa5d0">read()</a> or <a class="el" href="class_fake_stream.html#a8db1c0fea7e029cd3ba23cfe8676e205">peek()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">b</td><td>the byte value </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8db1c0fea7e029cd3ba23cfe8676e205"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FakeStream::peek </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a byte without removing it from the stream.</p>
<dl class="section return"><dt>Returns</dt><dd>the byte passed to <a class="el" href="class_fake_stream.html#a4b37e51beae0c92064eb81c06b5076cd">nextByte()</a> or -1 (end-of-stream) if <a class="el" href="class_fake_stream.html#a4b37e51beae0c92064eb81c06b5076cd">nextByte()</a> has not been called or <a class="el" href="class_fake_stream.html#a5e310812ee74cf355b8fde8edb1d8579">setToEndOfStream()</a> has been called </dd></dl>

</div>
</div>
<a class="anchor" id="a5d11124a60e344a1baf58afd696aa5d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int FakeStream::read </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads a byte, removing it from the stream.</p>
<dl class="section return"><dt>Returns</dt><dd>the byte passed to <a class="el" href="class_fake_stream.html#a4b37e51beae0c92064eb81c06b5076cd">nextByte()</a> or -1 (end-of-stream) if <a class="el" href="class_fake_stream.html#a4b37e51beae0c92064eb81c06b5076cd">nextByte()</a> has not been called or <a class="el" href="class_fake_stream.html#a5e310812ee74cf355b8fde8edb1d8579">setToEndOfStream()</a> has been called </dd></dl>

</div>
</div>
<a class="anchor" id="a5e310812ee74cf355b8fde8edb1d8579"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FakeStream::setToEndOfStream </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the next value to be read via <a class="el" href="class_fake_stream.html#a5d11124a60e344a1baf58afd696aa5d0">read()</a> or <a class="el" href="class_fake_stream.html#a8db1c0fea7e029cd3ba23cfe8676e205">peek()</a> to -1 (end-of-stream). </p>

</div>
</div>
<a class="anchor" id="a02fd44b84cc3ca6dc3f91eb9b78e097a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t FakeStream::write </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes a byte to this stream. The byte is recorded by appending it to the internal store and can be observed by calling <a class="el" href="class_fake_stream.html#a1b2f32a9257cba71c6056a3bc02eac6f">bytesWritten()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>the byte to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes written (always 1) </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/utility/<a class="el" href="_fake_stream_8h_source.html">FakeStream.h</a></li>
<li>src/utility/FakeStream.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 12 2013 17:50:17 for ArduinoUnit 2.0 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>
